#include<bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin >> n;
	string s;
	cin >> s;
	if(n % 2 == 0) {
		cout << "No" << endl;
		return 0;
	}
	int y = n / 2;
	for(int i = 0; i < y; i ++ ) {
		if(s[i] != '1') {
			cout << "No" << endl;
			return 0;
		}
	}
	if(s[y] != '/') {
		cout << "No" << endl;
		return 0;
	}
	for(int i = y + 1; i < n; i ++ ) {
		if(s[i] != '2') {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

